Use Convert2RHEL repofiles instead of deprecated repos for tests - #20869
Merged
Conversation
Contributor
Reviewer's GuideReplaces hard-coded Convert2RHEL repository base URLs in tests with base URLs dynamically extracted from new .repo files, adding a helper to fetch the baseurl from a remote repofile and wiring tests to use the new setting key. Sequence diagram for tests using Convert2RHEL repofiles to resolve baseurlsequenceDiagram
actor Tester
participant TestCase
participant ContentInfo
participant RemoteRepoServer
Tester->>TestCase: run_convert2rhel_test()
TestCase->>ContentInfo: get_baseurl_by_repofile(repo_url, verify_ssl)
ContentInfo->>RemoteRepoServer: HTTP GET repo_url
RemoteRepoServer-->>ContentInfo: 200 OK, .repo file content
ContentInfo->>ContentInfo: scan lines for baseurl=
ContentInfo-->>TestCase: baseurl
TestCase->>TestCase: configure_convert2rhel_repo(baseurl)
TestCase-->>Tester: assertions on Convert2RHEL behavior
Class diagram for updated content_info module helper functionsclassDiagram
class ContentInfo {
+get_repo_files_by_url(url, extension)
+get_baseurl_by_repofile(repo_url, verify_ssl)
+get_repo_files_urls_by_url(url, extension)
+get_repomd(repo_url)
}
Flow diagram for get_baseurl_by_repofile helper logicflowchart TD
A[Start get_baseurl_by_repofile] --> B[Call requests.get with repo_url and verify_ssl]
B --> C{HTTP response OK?}
C -- No --> D[raise_for_status triggers HTTPError]
C -- Yes --> E[Split response text into lines]
E --> F[Iterate over each line]
F --> G[Strip whitespace from line]
G --> H{Does line start with baseurl= ?}
H -- Yes --> I[Extract substring after = and strip]
I --> J[Return baseurl]
H -- No --> K{More lines?}
K -- Yes --> F
K -- No --> L[Raise ValueError: No baseurl found]
J --> M[End]
L --> M
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
There was a problem hiding this comment.
Hey - I've found 1 issue, and left some high level feedback:
- Consider parsing the .repo file using Python’s
configparser(INI-style) instead of manually scanning lines inget_baseurl_by_repofile, so you can robustly handle multiple sections, whitespace variations, and potential future extensions in the repo format.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider parsing the .repo file using Python’s `configparser` (INI-style) instead of manually scanning lines in `get_baseurl_by_repofile`, so you can robustly handle multiple sections, whitespace variations, and potential future extensions in the repo format.
## Individual Comments
### Comment 1
<location path="robottelo/content_info.py" line_range="72" />
<code_context>
return sorted([os.path.basename(f) for f in get_repo_files_urls_by_url(url, extension)])
+def get_baseurl_by_repofile(repo_url, verify_ssl=False):
+ """
+ Returns the baseurl from a remote yum .repo file.
</code_context>
<issue_to_address>
**🚨 issue (security):** Defaulting verify_ssl to False weakens HTTPS protection and can hide TLS issues.
Because `verify_ssl` defaults to `False`, certificate validation is disabled unless callers explicitly opt in, which can hide configuration issues and enable MITM on untrusted networks. Please default `verify_ssl` to `True` and only disable it at specific call sites that genuinely require skipping verification.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Member
Author
|
Collaborator
|
PRT Result |
Member
|
Is the EL7 failure related? It seems to happen much later than the repo syncing, so I guess not? |
Member
Author
|
Yes, EL7 failure isn't related to these change and looks like an intermittent issue |
Signed-off-by: Gaurav Talreja <gtalreja@redhat.com>
Gauravtalreja1
force-pushed
the
update-c2r-repos
branch
from
February 26, 2026 08:35
e498ab7 to
f99237b
Compare
evgeni
approved these changes
Feb 26, 2026
shubhamsg199
approved these changes
Feb 26, 2026
shubhamsg199
left a comment
Contributor
There was a problem hiding this comment.
Ack, The one failure looks unrelated to this change
github-actions Bot
pushed a commit
that referenced
this pull request
Feb 26, 2026
) Signed-off-by: Gaurav Talreja <gtalreja@redhat.com> (cherry picked from commit 0644d11)
github-actions Bot
pushed a commit
that referenced
this pull request
Feb 26, 2026
) Signed-off-by: Gaurav Talreja <gtalreja@redhat.com> (cherry picked from commit 0644d11)
This was referenced Feb 26, 2026
github-actions Bot
pushed a commit
that referenced
this pull request
Feb 26, 2026
) Signed-off-by: Gaurav Talreja <gtalreja@redhat.com> (cherry picked from commit 0644d11)
github-actions Bot
pushed a commit
that referenced
this pull request
Feb 26, 2026
) Signed-off-by: Gaurav Talreja <gtalreja@redhat.com> (cherry picked from commit 0644d11)
This was referenced Feb 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem Statement
Solution
Related Issues
Summary by Sourcery
Update Convert2RHEL API tests to derive repository base URLs from remote .repo files instead of using deprecated repository URLs directly.
Enhancements:
Tests: